using System;
using System.Data;
using System.Data.SqlClient;
using DTN.Core.Utilities;
namespace com.dtn.deals
{
	public class CommentInfo
	{
		private int id;
		public int Id
		{
			get { return id; }
			set { id = value; }
		}

		private int objId;
		public int ObjId
		{
			get { return objId; }
			set { objId = value; }
		}

		private int userId;
		public int UserId
		{
			get { return userId; }
			set { userId = value; }
		}

		private string email;
		public string Email
		{
			get { return email; }
			set { email = value; }
		}

		private string nickName;
		public string NickName
		{
			get { return nickName; }
			set { nickName = value; }
		}

		private string comment;
		public string Comment
		{
			get { return comment; }
			set { comment = value; }
		}

		private DateTime createdDate;
		public DateTime CreatedDate
		{
			get { return createdDate; }
			set { createdDate = value; }
		}

		public CommentInfo()
		{
		}
		public CommentInfo(DataRow info)
		{
			id = ConvertUtility.ToInt32(info["Id"]);
			objId = ConvertUtility.ToInt32(info["ObjId"]);
			userId = ConvertUtility.ToInt32(info["UserId"]);
			email = ConvertUtility.ToString(info["Email"]);
			nickName = ConvertUtility.ToString(info["NickName"]);
			comment = ConvertUtility.ToString(info["Comment"]);
			createdDate = ConvertUtility.ToDateTime(info["CreatedDate"]);
		}
        public CommentInfo(DataRowView info)
        {
            id = ConvertUtility.ToInt32(info["Id"]);
            objId = ConvertUtility.ToInt32(info["ObjId"]);
            userId = ConvertUtility.ToInt32(info["UserId"]);
            email = ConvertUtility.ToString(info["Email"]);
            nickName = ConvertUtility.ToString(info["NickName"]);
            comment = ConvertUtility.ToString(info["Comment"]);
            createdDate = ConvertUtility.ToDateTime(info["CreatedDate"]);
        }
		public CommentInfo(SqlDataReader dr)
		{
			id = ConvertUtility.ToInt32(dr["Id"]);
			objId = ConvertUtility.ToInt32(dr["ObjId"]);
			userId = ConvertUtility.ToInt32(dr["UserId"]);
			email = ConvertUtility.ToString(dr["Email"]);
			nickName = ConvertUtility.ToString(dr["NickName"]);
			comment = ConvertUtility.ToString(dr["Comment"]);
			createdDate = ConvertUtility.ToDateTime(dr["CreatedDate"]);
		}
	}
}

